﻿<Window x:Class="Notoric.Gui.Windows.MusicSectionPropertiesDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ls="clr-namespace:LukasKopenec.LocalizationSupport;assembly=LocalizationSupport"
        xmlns:rb="clr-namespace:Fluent;assembly=Fluent"
        xmlns:vm="clr-namespace:Notoric.ViewModel;assembly=ViewModel"
        xmlns:vme="clr-namespace:Notoric.ViewModel.Elements;assembly=ViewModel"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Title="Insert Music Section" Height="300" Width="507"
        WindowStartupLocation="CenterScreen" Background="#FFF0F0F0">
    <StackPanel>
        <Grid Background="White" Height="200" HorizontalAlignment="Stretch" Margin="7 7 7 0">
            <Grid.RowDefinitions>
                <RowDefinition Height="24"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="180"/>
                <ColumnDefinition Width="140"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Label Content="Composition:" Grid.Column="0" Grid.Row="0"/>
            <TreeView x:Name="PART_CompositionsTree" ItemsSource="{Binding Compositions.Children}" Grid.Row="1" Grid.Column="0" SelectedItemChanged="PART_CompositionsTree_SelectedItemChanged">
                <TreeView.Resources>
                    <DataTemplate DataType="{x:Type vme:Composition}">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding Path=Icon, Mode=OneWay}" Height="16" Width="16" Margin="0 0 4 0"/>
                            <TextBlock Text="{Binding Path=DisplayName, Mode=OneWay}"/>
                        </StackPanel>
                    </DataTemplate>

                    <HierarchicalDataTemplate DataType="{x:Type vm:Directory}"  ItemsSource="{Binding Path=Children, Mode=OneWay}">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding Path=Icon, Mode=OneWay}" Height="16" Width="16" Margin="0 0 4 0"/>
                            <TextBlock Text="{Binding Path=DisplayName, Mode=OneWay}"/>
                        </StackPanel>
                    </HierarchicalDataTemplate>
                </TreeView.Resources>
            </TreeView>
            <Label Content="Parts:" Grid.Column="1" Grid.Row="0"/>
            <ListBox x:Name="PART_PresentedParts" Margin="7 0 0 0" Grid.Row="1" Grid.Column="1">
                <ListBox.ItemTemplate>
                    <DataTemplate DataType="{x:Type vme:PartDescriptor}">
                        <StackPanel Orientation="Horizontal">
                            <CheckBox IsChecked="True" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" />
                            <TextBlock Text="{Binding Name, Mode=OneWay}"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Label Content="Measures:" Grid.Column="2" Grid.Row="0"/>
            <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="2" Margin="7 0 0 0">
                <Label Content="First Measure:" />
                <rb:Spinner x:Name="PART_FirstMeasure" Format="0" Minimum="1" Value="{Binding FirstMeasure, Mode=OneWayToSource}" IsEnabled="False"/>
                <Label Content="Last Measure:" Margin="0 7 0 0"/>
                <rb:Spinner x:Name="PART_LastMeasure" Format="0" Minimum="{Binding ElementName=PART_FirstMeasure, Path=Value, Mode=OneWay}" Value="{Binding LastMeasure, Mode=OneWayToSource}" IsEnabled="False"/>
                <Label Content="Measures per System:" Margin="0 7 0 0"/>
                <rb:Spinner x:Name="PART_MeasuresPerSystem" Format="0" Minimum="1" Maximum="10" Value="{Binding MeasuresPerSystem, Mode=OneWayToSource}" IsEnabled="False" />
            </StackPanel>
        </Grid>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 10 7 0">
            <Button x:Name="PART_OK" Content="{ls:Localize Windows.OKButton}" Width="60" IsDefault="True" Click="PART_OK_Click" IsEnabled="False"/>
            <Button x:Name="PART_Cancel" Content="{ls:Localize Windows.CancelButton}" Margin="6 0 0 0" Width="60" IsCancel="True" Click="PART_Cancel_Click" />
        </StackPanel>
    </StackPanel>
</Window>
